<?php

class Application_Form_LogOn extends Zend_Form
{

    public function init()
    {
         $this->setMethod('post');

        $email = $this->addElement('text', 'email', array(
            'label'      => 'E-mail:',
            'required'   => true,
            'filters'    => array('StringTrim'),
            'validators' => array(
                'EmailAddress',
            )
        ));

        $senha = $this->addElement('password', 'senha', array(
            'filters'    => array('StringTrim'),
            'validators' => array(
                'Alnum',
                array('StringLength', false, array(6, 20)),
            ),
            'required'   => true,
            'label'      => 'Senha:',
        ));

        //botao de criar conta
        $criar = $this->addElement('submit', 'submit', array(
            'ignore'   => true,
            'label'    => 'Entrar',
        ));

        // alguma protecao contra flood.
        $this->addElement('hash', 'csrf', array(
            'ignore' => true,
        ));

        $this->setDecorators(array(
            'FormElements',
            array('HtmlTag', array('tag' => 'dl', 'class' => 'zend_form')),
            array('Description', array('placement' => 'prepend')),
            'Form'
        ));
    }


}

